<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
<link rel="shortcut icon" href="image/favicon.ico" type="image/x-icon" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body class="skin-blue">
    <div class="">
      <!-- Content Wrapper. Contains page content -->
      <div class="">
        <!-- Content Header (Page header) -->
        <section class="content-header">
		<h1>
			<ol class="breadcrumb">
				
				<li>友情链接</li>
			</ol>
          </h1>

		  
        </section>

        <!-- Main content -->
        <section class="content">
       
                 <a href="<%=basePath%>admin/goaddlj" style="margin-right:0px;"><button   class="btn  btn-info btn-xs info" style="width:80px;">添加</button></a>
          <div class="row">
            <div class="col-xs-12">
			
              <div class="box">
				
                <div class="box-body">
                
                  <table id="example2" class="table table-bordered table-hover">
                    <thead>
                      <tr>
						<th>编号</th>
                        <th>标题</th>
                        <th>链接</th>
                        <th>类型</th>
						<th>操作</th>
						
					</tr>
                    </thead>
					
                    <tbody>
					  
					 <c:forEach items="${ljlist}" var="pic" >
                      <tr>    
                        
						<td>${pic.id }</td>
						
						<td>${pic.title}</td>
						<td>${pic.url}</td>
                      	<td>${pic.type}</td>
                        <td>
                       	 	<button   onclick="pub(${pic.id})" class="btn  btn-info btn-xs info" style="width:50px;">发布</button>
							<button   onclick="del(${pic.id})" class="btn  btn-info btn-xs info" style="width:50px;">删除</button>
						</td>
                      </tr>
                     </c:forEach> 
					  
                    </tbody>

                  </table>

                 <!-- 翻页 --> 
 
                </div><!-- /.box-body -->
              </div><!-- /.box -->
            
              
            </div><!-- /.col -->
          </div><!-- /.row -->
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->
      
	 
	</div><!-- ./wrapper -->
	<script type="text/javascript">

		$("#activitys").addClass("active");
		$("#activitys").find("li:first").addClass("active");

	
	

        $("#example2").dataTable({
		 	"bPaginate": true, // 翻页功能
			"bLengthChange": false, // 改变每页显示数据数量
			"bFilter": false, // 过滤功能
			"bSort": false, // 排序功能
			"bInfo": true, // 页脚信息
			"oLanguage" : {
                "sLengthMenu" : "每页显示_MENU_条记录",
                "sZeroRecords" : "抱歉， 没有找到记录",
                "sInfo" : "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty" : "没有数据",
                "sInfoFiltered" : "(从 _MAX_ 条数据中检索)",
                "oPaginate" : {
                    "sFirst" : "首页",
                    "sPrevious" : "前一页",
                    "sNext" : "后一页",
                    "sLast" : "尾页"
                },
                "sZeroRecords" : "没有检索到数据",
                "sProcessing" : "正在加载中..."
            },
			"bAutoWidth": true, // 自动宽度
		});
		

	  function del(id) {
	  location.href= "<%=basePath%>admin/dellj?id="+id; }
	   function pub(id) {
	  location.href= "<%=basePath%>admin/publj?id="+id; }
	</script>
  </body>
</html>
